<?php
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
loadcache('plugin');
if(!defined('Adz_class')){include('source/plugin/alias/Adz.class.php');}
Adz::auth_admin();//判断权限
function alias_init_replace($note){
	return str_replace(array('init();','?>'),array("init();\n".'include(DISCUZ_ROOT.\'./source/plugin/alias/alias.ini1.php\');','include(DISCUZ_ROOT.\'./source/plugin/alias/alias.ini2.php\');'."\n?>"),$note);
}
if(!file_put_contents(DISCUZ_ROOT.'./alias.php',' ')){
	echo '<hr>'.lang('plugin/alias','no_write');exit;
}
$note = file_get_contents(DISCUZ_ROOT.'./forum.php');
file_put_contents(DISCUZ_ROOT.'./alias.php',alias_init_replace($note));
$note = file_get_contents(DISCUZ_ROOT.'./misc.php');
file_put_contents(DISCUZ_ROOT.'./alias_misc.php',alias_init_replace($note));
echo '<hr>'.lang('plugin/alias','init_success');
?>